﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UserQuanXianManager
{
	public partial class AddNewGroup : Form
	{
		public AddNewGroup()
		{
			InitializeComponent();
		}

		private void bt_OK_Click(object sender, EventArgs e)
		{
			using (var context = new blackbirdEntities())
			{
				group gp = new group();
				gp.Name = tbName.Text;
				gp.Description = tbDescription.Text;

				context.group.AddObject(gp);
				context.SaveChanges();
			}

			this.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.Close();
		}
	}
}
